﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using ControlLib;
using AbstractFramework;
using AbstractFramework.LogicControl;
using AbstractFramework.Display;

namespace WpfElevator.ElevatorPart
{
    class Door : IDoor
    {
        //private ElevatorStatus doorState;
        private IElevator elevatorOfDoor;//door所对应的电梯标识
        //public ElevatorStatus DoorState
        //{
        //    get{ return doorState;}
        //    set{ doorState = value;}
        //}
        public IElevator ElevatorOfDoor
        {
            get { return elevatorOfDoor; }
            set { elevatorOfDoor = value; }
        }
        public Door()
        {
        }
        public Door(IElevator elevator)
        {
            this.elevatorOfDoor = elevator;
        }
        //方法
        public bool open(IElevatorDisplay elevatorDisplay)//bool类型返回值：1）返回true：open操作执行成功；2）false：open操作失败
        {
            elevatorDisplay.open(true);
            //elevatorOfDoor.State = ElevatorStatus.Opened;
            return true;
        }
        public bool close(IElevatorDisplay elevatorDisplay)//return =  1）true: close 操作成功；2）false：close操作失败
        {
            elevatorDisplay.close(true);
            //elevatorOfDoor.State = ElevatorStatus.Stoped;
            return true;
        }
    }
    class ElevatorDoor : Door
    {
    }
    class FloorDoor : Door
    {
    }
}
